import React, { Component } from 'react'
import "./App.less"
import Tabbar from './components/Tabbar/Tabbar'
import { withRouter } from 'react-router-dom'
import Loading from '@/components/Loading/Loading'
import MyArert from '@/components/MyArert/MyArert'
class App extends Component {
  // 类组件有this.props.history
  render() {
    return (
      <>
        {this.props.children}
        <Tabbar history={this.props.history} />
        <Loading />
        <MyArert />
      </>
    )
  }
  componentDidMount() {
    // 当前项目 / 直接跳到 /home
    if (this.props.location.pathname === "/")
      this.props.history.push("/home");
  }
}

export default withRouter(App)